package util;

import org.apache.commons.codec.binary.Base64;

import java.io.UnsupportedEncodingException;

/**
 * Created by Administrator on 2017/9/14.
 */
public class Base64Util {

    public static String encodeBase64(String par) {
        byte[] encodeBase64 = new byte[0];
        try {
            encodeBase64 = Base64.encodeBase64(par.getBytes("UTF-8"));
            return new String(encodeBase64);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }

}
